cmake_minimum_required(VERSION 2.6)

PROJECT(AYE)
SET(AYE_VERSION 0.1.0)

OPTION(BUILD_MACOSX_BUNDLE "Build bundle apps on mac." 0)

SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "AYE")
SET(CPACK_PACKAGE_VENDOR "VC NUDT")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
SET(CPACK_PACKAGE_VERSION_MAJOR "0")
SET(CPACK_PACKAGE_VERSION_MINOR "1")
SET(CPACK_PACKAGE_VERSION_PATCH "1")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
SET(CPACK_GENERATOR "DragNDrop;ZIP")
IF(APPLE)
  set(CPACK_BINARY_DRAGNDROP ON)
ENDIF()

SET(CPACK_STRIP_FILES "bin/MyExecutable")
SET(CPACK_SOURCE_STRIP_FILES "")
SET(CPACK_SOURCE_IGNORE_FILES "/CMakeLists.txt.user$;/bin/;/build/;/CVS/;/\\\\.svn/;/\\\\.bzr/;/\\\\.hg/;/\\\\.git/;\\\\.swp$;\\\\.#;/#;.*~$" CACHE STRING "CPACK will ignore this files" )
INCLUDE(CPack)

SET(CMAKE_INSTALL_RPATH "../lib")

SET(EXECUTABLE_OUTPUT_PATH ${AYE_BINARY_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${AYE_BINARY_DIR}/lib)

IF (NOT WIN32)
  SET(NESTK_USE_FREENECT 1)
ENDIF()

SET(NESTK_USE_OPENNI 1)

# Enable these by default when not on Windows neither on Mac.
IF (UNIX AND NOT APPLE AND NOT DEFINED NESTK_USE_PCL)
  SET(NESTK_USE_PCL 1)
ENDIF()

ADD_SUBDIRECTORY(nestk)
## nestk/UseNestk.cmake.in defines variable to use nestk.
## It itself includes nestk/deps/cmake/UseEmbeddedNestkDeps.cmake that
## contains most of the cmake find packages commands.
INCLUDE("${NESTK_EMBEDDED_USE_FILE}")

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${NESTK_EXTRA_CMAKE_CXX_FLAGS}" )
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})

ADD_SUBDIRECTORY(calibration)
ADD_SUBDIRECTORY(viewer)
ADD_SUBDIRECTORY(reconstructor)
ADD_SUBDIRECTORY(people-tracker)

IF (NESTK_USE_OPENNI)
  ADD_SUBDIRECTORY(skeletor)
ENDIF()

IF (NESTK_USE_OPENNI AND NESTK_USE_PCL)
  ADD_SUBDIRECTORY(multikinect)
  ADD_SUBDIRECTORY(object)
ENDIF()
